import flRequest from '../../index'

import { IAccount, ILoginResult, ISMSParams, IReset } from './type'
import { IDataType } from '../../type'
enum LoginAPI {
  Doctor_Index = 'Doctor_Index.Login', //医生登录
  HealthLogin = 'Doctor_Index.HealthLogin', //健康管理师登录
  GetSMS = 'Doctor_Index.SendSms', // 获取验证码
  ResetPassword = 'Doctor_Index.ResetPassword' // 重置密码
}
export function Login(url: string, postData: IAccount) {
  return flRequest.post<IDataType<ILoginResult>>({
    url: url == '1' ? LoginAPI.Doctor_Index : LoginAPI.HealthLogin,
    data: postData
  })
}
export function GetSMS(params: ISMSParams) {
  return flRequest.get({
    url: LoginAPI.GetSMS,
    params,
    showLoading: false
  })
}
export function ResetPassword(postData: IReset) {
  return flRequest.post({
    url: LoginAPI.ResetPassword,
    data: postData
  })
}
// export function DoctorInfo() {
//   return flRequest.get({
//     url: DoctorApi.DoctorInfo,
//     showLoading: false
//   })
// }
